import {Modal} from "view-design";
import {Api} from "@/api";
import {sessionStorage} from "@/common/cacheUtils";

function companInterceptor(to, from, next) {
  let check = sessionStorage('envInfoComan').get('check')
  if (check == '2') {
    Modal.warning({
      title: '提示',
      content: '<p>请先填报企业基本信息,如已填报请填写安全和环保责任人</p>',
      okText: '确认',
      onOk: () => {
        next("/envinfocompan");
      },
    })
  } else {
    next();
  }

}

export default [
  // 安全管理
  // 安全三同时
  ...[
    {
      path: '/threeSimProject', name: 'threeSimProject',
      component: () =>
          import( /* webpackPrefetch: true */'@/views/safe/threesim/threeSimProject.vue')
    },
    {
      path: '/threeSimProject/create', name: 'threeSimProjectCreate',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/threesim/threeSimProject.vue')
    }, {
      path: '/saThreeSim', name: 'saThreeSim',
      component: () =>
          import( /* webpackPrefetch: true */'@/views/safe/threesim/safeThreeSim.vue')
    }, {
      path: '/healthThreeSim',    name: 'healthThreeSim',
      component: () =>
          import( /* webpackPrefetch: true */'@/views/safe/threesim/healthyThreeSim.vue')
    }, {
      path: '/fireControllThreeSim',    name: 'fireControllThreeSim',
      component: () =>
          import( /* webpackPrefetch: true */'@/views/safe/threesim/fireControllThreeSim.vue')
    },
  ],
  // 职业健康管理
  ...[
    {
      path: '/hazardsFactor', name: 'safeHealthHazardsFactor',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/health/hazardsFactor/index.vue')
    },
    {
      path: '/hazardsType', name: 'safeHealthHazardsType',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/health/hazardsType/index.vue')
    },
    {
      path: '/injuredPost', name: 'safeHealthInjuredPost',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/health/injuredPost/index.vue')
    },
    {
      path: '/injuredPersonnel', name: 'safeHealthInjuredPersonnel',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/health/injuredPersonnel/index.vue')
    },
    {
      path: '/examinationResult', name: 'safeHealthExaminationResult',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/health/examinationResult/index.vue')
    },

  ],
  // 安全报表
  ...[
    {
      // 1.月度接受检查情况
      path: '/acceptInspectSafeRpt', name: 'safe-rpt-acceptInspect',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/acceptInspectSafeRpt/index.vue')
    },
    {
      // 1.1 月度接受检查情况
      path: '/acceptInspectSafeStatistics', name: 'safe-statistics-acceptInspect',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/acceptInspectSafeRpt/statistics.vue')
    },
    {
      // 2.月度公司层面会议
      path: '/companySafeEnStatusSafeRpt', name: 'safe-rpt-companySafeEnStatus',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/companySafeEnStatusSafeRpt/index.vue')
    },
    {
      // 2.1 月度公司层面会议
      path: '/companySafeEnStatusSafeStatistics', name: 'safe-statistics-companySafeEnStatus',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/companySafeEnStatusSafeRpt/statistics.vue')
    },
    {
      // 3.月度工伤报表
      path: '/injurySafeRpt',    name: 'safe-rpt-injurySafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/injurySafeRpt/index.vue')
    },
    {
      // 3.1 月度工伤报表 统计分析
      path: '/injurySafeStatistics',    name: 'safe-statistics-injurySafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/injurySafeRpt/statistics.vue')
    },
    {
      // 4.工程建设
      path: '/constructSafeRpt',    name: 'safe-rpt-constructSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/constructSafeRpt/index.vue')
    },
    {
      // 5.安全标准化
      path: '/standardSafeRpt',    name: 'safe-rpt-standardSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/standardSafeRpt/index.vue')
    },
    {
      // 6.安全生产许可证
      path: '/productLicenceSafeRpt',    name: 'safe-rpt-productLicenceSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/productLicenceSafeRpt/index.vue')
    },
    {
      // 7.矿山登记表
      path: '/mineSafeRpt',    name: 'safe-rpt-mineSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/mineSafeRpt/index.vue')
    },
    {
      path: '/mineConstruStatistice',    name: 'mineConstruStatistice',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/mineSafeRpt/mineConstruStatistice.vue')
    },
    {
      path: '/mineEcoloaicalRestStatistic',    name: 'mineEcoloaicalRestStatistic',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/mineSafeRpt/mineEcoloaicalRestStatistic.vue')
    },
    {
      // 8.职业健康
      path: '/healthSafeRpt',    name: 'safe-rpt-healthSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/healthSafeRpt/index.vue')
    },
    {
      // 8.1.职业健康统计分析
      path: '/healthSafeRptStatistics',    name: 'safe-rpt-healthSafeRptStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/healthSafeRpt/statistics.vue')
    },
    {
      // 9.消防重点部位
      path: '/fireSafeRpt',    name: 'safe-rpt-fireSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/fireSafeRpt/index.vue')
    },
    {
      // 9.1. 消防重点部位统计分析
      path: '/fireSafeStatistics', name: 'fireSafeStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/fireSafeRpt/statistics.vue')
    },
    {
      // 10.特种设备
      path: '/specialEqSafeRpt',    name: 'specialEqSafeRpt',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/specialEqSafeRpt/index.vue')
    },
    {
      // 10.特种设备（待检设备）
      path: '/eqAccountPending',    name: 'eqAccountPending',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/specialEqSafeRpt/index.vue')
    },
    {
      // 10.1 .特种设备统计分析
      path: '/specialEqSafeStatistics',    name: 'safe-statistics-specialEq',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/specialEqSafeRpt/statistics.vue')
    },
    {
      // 11.治安重点部位
      path: '/secStatSafeRpt',    name: 'safe-rpt-secStat',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/secStatSafeRpt/index.vue')
    },
    {
      // 11.1. 治安重点部位统计分析
      path: '/secStatSafeStatistics', name: 'secStatSafeStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/secStatSafeRpt/statistics.vue')
    },
    {
      // 12.安全监督检查表
      path: '/safeSuperviseInspectRpt', name: 'sa_rpt_supervise_inspect',
      component: () => import( /* webpackPrefetch: true */'@/views/safe/rpt/superviseInspectRpt/index.vue'),
      beforeEnter: companInterceptor
    }
  ],

  // 环保管理
  // 环保标准化管理
  ...[
    {
      path: '/standard',    name: 'standard',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/standardItem.vue')
    }, {
      path: '/selfCheckEvaluation', name: 'selfCheckEvaluation',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/index.vue'),
      beforeEnter: companInterceptor
    },
    {
      path: '/selfCheckStatistic',    name: 'selfCheckStatistic',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/selfCheckStatistic.vue')
    },
    {
      path: '/selfEvaluationStatistic',    name: 'selfEvaluationStatistic',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/selfEvaluationStatistic.vue')
    },
    {
      path: '/evaluationResultAggregate',    name: 'evaluationResultAggregate',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/evaluationResultAggregate.vue')
    },
    {
      path: '/selfReportStatistic',    name: 'selfReportStatistic',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfReportStatistic.vue')
    },
    {
      path: '/evaluationResultAggregateStatistics',    name: 'evaluationResultAggregateStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/evaluationResultAggregateStatistics.vue')
    },
    {
      path: '/selfEvaluationResult', name: 'selfEvaluationResult',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfcheckevaluation/index.vue'),
      beforeEnter: companInterceptor
    },
    {
      path: '/selfCheckReport', name: 'selfCheckReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/selfreport.vue')
    },
    {
      path: '/standardIndex', name: 'standardIndex',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/standardIndex.vue')
    },
    {
      path: '/evaluationSummary', name: 'evaluationSummary',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/evaluationSummary.vue')
    },
    {
      path: '/annualReport', name: 'annualReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/annualReport.vue')
    },
    {
      path: '/annualProblemRectify', name: 'annualProblemRectify',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/annualProblemRectify.vue')
    },
    {
      path: '/problemRectify', name: 'problemRectify',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/problemRectify.vue')
    },
      {
          path: '/problemRectifyDetails', name: 'problemRectifyDetails',
          component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/problemRectifyDetails.vue')
      },
    {
      path: '/annualProblemStatistic', name: 'annualProblemStatistic',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/standardization/annualProblemStatistic.vue')
    },
  ],
  // 环保三同时
  ...[
    {
      path: '/envThreeSimProject', name: 'envThreeSimProject',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/threesim/threeSimProject.vue')
    },
    {
      path: '/envThreeSimProject/create', name: 'envThreeSimProjectCreate',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/threesim/threeSimProject.vue')
    },
    {
      path: '/threesim', name: 'threesim',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/threesim/envThreeSim.vue')
    }
  ],
  // 清洁生产管理
  ...[
    {
      path: '/noiseDisc', name: 'noiseDisc',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/noiseDisc/index.vue')
    },
    {
      path: '/gasDisc', name: 'gasDisc',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/gasDisc/index.vue')
    },
    {
      path: '/sewageDisc', name: 'sewageDisc',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/sewageDisc/index.vue')
    },
    {
      path: '/waterConsum', name: 'waterConsum',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/waterConsum/index.vue')
    },
    {
      path: '/savingProject', name: 'savingProject',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/savingProject/index.vue')
    }, {
      path: '/dspInfo', name: 'dspInfo',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/dspInfo/index.vue')
    }, {
      path: '/dspInfoStatistics', name: 'dspInfoStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/dspInfo/statistics.vue')
    }, {
      path: '/prdAuditForm', name: 'prdAuditForm',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/prdAuditWork/AuditForm.vue')
    },
    {
      path: '/AuditFormStatistics', name: 'AuditFormStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/prdAuditWork/AuditFormStatistics.vue')
    },
    {
      path: '/prdEvaluationForm', name: 'EvaluationForm',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/prdAuditWork/EvaluationForm.vue')
    }, {
      path: '/prdEvaluationFormStatistics', name: 'EvaluationFormStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/cleanprd/prdAuditWork/statistics.vue')
    }
  ],
  // 环保报表
  ...[
    {
      // 1.环保监督检查表
      path: '/envSuperviseInspectRpt', name: 'en_rpt_supervise_inspect',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/superviseInspectRpt/index.vue'),
      beforeEnter: companInterceptor
    },
    {
      // 2.重污染天气预警响应
      path: '/hePoWeatherWarningResponse',    name: 'en_rpt_he_po_weather_warning_response',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/hePoWeatherWarningResponseRpt/index.vue')
    },
	{
      // 2.重污染天气预警响应
      path: '/enDailyPaper',    name: 'en_daily_paper',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/daily/dailyPaper.vue')
    },
    {
      // 3.环境信息半年报
      path: '/semiAnnual',    name: 'en_rpt_semi_annual',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/semiAnnualRpt/index.vue')
    },
    {
      // 3.1.环境信息半年报统计分析
      path: '/semiAnnualStatistics',    name: 'en_semi_Annual_Statistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/semiAnnualRpt/statistics.vue')
    },
    {
      // 3.环境信息半年报
      path: '/semiAnnualCompany',    name: 'en_rpt_semi_annual_company',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/semiAnnualRpt/semiAnnualCompany.vue')
    },
    {
      // 4.环境信息年报
      path: '/enRptAnnual', name: 'enRptAnnual',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/annual/index.vue')
    },
    {
      // 4.1 .环境信息年报统计分析
      path: '/enRptAnnualStatistics', name: 'enRptAnnualStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/annual/statistics.vue')
    },
    {
      // 5. 环保投入汇总表
      path: '/enRptInvestment', name: 'enRptInvestment',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/investment/RptInvestmentNew.vue')
    },
      {
          // 5.1. 环保投入统计分析
          path: '/enRptInvestmentStatisticsNew', name: 'enRptInvestmentStatisticsNew',
          component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/investment/statisticsNew.vue')
      },
    {
      // 5.1. 环保投入按集团统计分析
      path: '/enRptInvestmentStatistics', name: 'enRptInvestmentStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/investment/statistics.vue')
    },
    {
      // 6. 重点行业绩效评级统计报表
      path: '/performanceRating', name: 'performanceRating',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/performanceRating/report.vue')
    },
    {
      // 7. 重点行业绩效评级统计
      path: '/performanceRatingStatistics', name: 'performanceRatingStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/performanceRating/statistics.vue')
    },
    {
      // 8. 重污染天气预警响应统计分析
      path: '/hePoWeatherWarningStatistics', name: 'hePoWeatherWarningStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/rpt/hePoWeatherWarningResponseRpt/statistics.vue')
    }
  ],
  // 环境事件管理
  ...[
    {
      path: '/envEvent', name: 'envEvent',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/eventSend/index.vue')
    },
    {
      path: '/envEventReport', name: 'envEventReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/eventReport/index.vue')
    },
    {
      path: '/envEventStatistics', name: 'envEventStatistics',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/envEventStatistics/index.vue')
    },
    {
      path: '/govInvReport', name: 'govInvReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/governmentInvestigationReport/index.vue')
    },
    {
      path: '/blocInvReport', name: 'blocInvReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/blocInvestigationReport/index.vue')
    },
    {
      path: '/companyInvReport', name: 'companyInvReport',
      component: () => import( /* webpackPrefetch: true */'@/views/environment/env/companyInvestigationReport/index.vue')
    }
  ],
]
